import dayjs from 'dayjs'
import  { useState } from 'react'
import { Calendar } from 'antd-mobile'

const Cal =  () => {
  const today = dayjs()
  const [val, setVal] = useState<[Date, Date] | null>(() => [
    today.subtract(2, 'day').toDate(),
    today.add(2, 'day').toDate(),
  ])
  return (
    <>
      
        <Calendar
          selectionMode='range'
          value={val}
          onChange={val => {
            setVal(val)
          }}
        />
      
    </>
  )
}
export default Cal